#!/usr/bin/python3
# _*_ coding: utf-8 _*_

'''
提示框
'''

import sys
from PyQt5.QtWidgets import (QWidget,
                             QToolTip,
                             QPushButton,
                             QApplication)
from PyQt5.QtGui import QFont


class Example(QWidget):
    def __init__(self):
        super(Example, self).__init__()

        self.initUI()

    def initUI(self):
        QToolTip.setFont(QFont("SansSerif", 12))

        self.setToolTip("This is a <b>QWidget</b> Widget")

        btn = QPushButton("Button", self)
        btn.setToolTip("This is a <b>QPushButton</b> Widget")
        btn.resize(btn.sizeHint())
        btn.move(50, 50)

        # x y w h
        self.setGeometry(300, 300, 300, 250)
        self.setWindowTitle("ToolTips")
        self.show()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())
